#ifndef COMMANDPROCESSOR_H
#define COMMANDPROCESSOR_H

#include <QObject>
#include <QString>
#include <QColor>

#include "LanguageToken.h"

class CommandProcessor : public QObject
{
    Q_OBJECT

public:
    typedef QList<QStringList> CommandList;

    explicit CommandProcessor(const LanguageToken &lang, QObject *parent = 0);
    virtual ~CommandProcessor();

    void processText(const QString &text);
    int processCommand(const QStringList &tokens, int start, CommandList &cmdList);

    void executeCommand(const QStringList &tokens);

private:
    const LanguageToken &_lang;

signals:

    void paraFrente(int steps);
    void paraTras(int steps);
    void girarDireita(int angulo);
    void girarEsquerda(int angulo);
    void pular(int steps);
    void forca(int forca);
    void limpar();
    void mudarCor(QColor cor);
    void erro(QString msg);

};

#endif // COMMANDPROCESSOR_H
